package tech.aistar.corejava.test;

import java.util.concurrent.Callable;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:https://www.cnblogs.com/baizhanshi/p/5469948.html
 * @date 2019/8/2 0002
 */
public class Task implements Callable<Integer>{
    @Override
    public Integer call() throws Exception {
        System.out.println("子线程正在计算...");
        Thread.sleep(1000);
        int sum = 0;
        for (int i = 0; i < 100; i++) {
            sum+=i;
        }
        return sum;
    }
}
class TaskTest{
    public static void main(String[] args) {

    }
}
